/*
  Copyright 2011 fullkawa

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
package jp.fullkawa.xnovel;

import java.util.ArrayList;
import java.util.List;

import jp.fullkawa.xnovel.connector.Connector;

/**
 * 複数の連続するカットをグループ化したもの
 * @author fullkawa
 */
public class Scene
{
	/**
	 * 選択肢のジャンプ先として参照される
	 */
	private String id;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	private List<Cut> cuts = new ArrayList<Cut>();

	public List<Cut> getCuts() {
		return cuts;
	}

	public void addCut(Cut cut)
	{
		cuts.add(cut);
		int num = cuts.size();
		cut.setNumber(num);
	}

	/**
	 * 次のシーンへの参照
	 * 全てのカットを表示し終わった後に表示される
	 */
	private Connector next;

	public Connector getNext() {
		return next;
	}

	public void setNext(Connector next) {
		this.next = next;
	}

	public String getStartTag()
	{
	    String tag = "<div id=\"" + (this.getId()==null ? "" : this.getId()) + "\">";
	    return tag;
	}

	public String getEndTag()
	{
	    return "</div>";
	}
}
